/********************************************
 * 功能说明: 
 * 模块名称: 
 * 系统名称: 
 * 软件版权: 
 * 系统版本: 1.0.0
 * 开发人员: Frank
 * 开发时间: 2019/8/31 19:11
 * 审核人员: 
 * 相关文档: 
 * 修改记录: 修改日期 修改人员 修改说明
 *********************************************/
package com.spring.arch.message.common.sender.sms.config;

import com.google.common.collect.Lists;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * 短信配置属性
 *
 * @author Frank
 * @version 1.0.0.1
 * @since 2019/8/31 19:11
 */
@Data
@ConfigurationProperties(prefix = SmsProperties.SMS_PREFIX)
public class SmsProperties {

    /**
     * sms prefix.
     */
    public final static String SMS_PREFIX = "sms";

    public final static String MONYUN_DEFAULT_SERVER_NODE = "101.251.214.153:8901";

    /**
     * sms switch  production is set to true, development set to false
     */
    private boolean enabled;

    /**
     * 阿里云短信配置
     */
    private Aliyun aliyun;

    /**
     * aliyun  sms config.
     */
    @Data
    public static class Aliyun {
        /**
         * aliyun sms sign name must not be null
         */
        private String signName;
        /**
         * aliyun sms access key
         */
        private String accessKeyId;
        /**
         * aliyun sms access key secret
         */
        private String accessKeySecret;

    }

    /**
     * 梦网云短信配置
     */
    @Data
    public static class Monyun {
        /**
         * monyun sms master-node must not be null
         */
        private List<String> serverNode = Lists.newArrayList(MONYUN_DEFAULT_SERVER_NODE);

        /**
         * aliyun sms user-id must not be null
         */
        private String userId;
        /**
         * aliyun sms password must not be null
         */
        private String password;

    }
}
